#include <iostream>
#include <utility>
#include <string>

using namespace std;

#include "Mymap.h"
#include "Myset.h"

void func(const xyx::map<int, int>& m)
{
	//auto mit = m.begin();
	xyx::map<int, int>::const_iterator mit = m.begin();
	while (mit != m.end())
	{
		// 不能修改key，不能修改value
		//mit->first = 1;
		//mit->second = 2;

		cout << mit->first << ":" << mit->second << endl;
		++mit;
	}
	cout << endl;
}

int main()
{
	//xyx::map<int, int> m;
	//m.insert(make_pair(1, 1));
	//m.insert(make_pair(4, 4));
	//m.insert(make_pair(3, 3));

	//func(m);

	//xyx::map<int, int>::iterator mit = m.begin();
	//while (mit != m.end())
	//{
	//	cout << mit->first << " : " << mit->second << endl;
	//	++mit;
	//}
	//cout << endl;

	//for (auto& e : m)
	//{
	//	cout << e.first << " : " << e.second << endl;

	//}
	//cout << endl;

	//xyx::set<int> s;
	//s.insert(3);
	//s.insert(7);
	//s.insert(2);
	//s.insert(1);
	//s.insert(8);
	//s.insert(9);
	//s.insert(1);

	//xyx::set<int>::iterator it = s.begin();
	//while (it != s.end())
	//{
	//	cout << *it << " ";
	//	//*it += 10;
	//	if (*it == 9) break;
	//	++it;
	//}
	//cout << endl;

	//for (auto& e : s)
	//{
	//	cout << e << " " ;

	//}
	//cout << endl;

	//while (it != s.begin())
	//{
	//	cout << *it << " ";
	//	//*it += 10;
	//	--it;
	//}

	xyx::map<string, string>dict;
	dict.insert(make_pair("left", "xxx"));
	dict["left"] = "左边";
	dict["right"] = "右边";

	for (auto& kv : dict)
	{
		cout << kv.first << " : " << kv.second << endl;
	}
	cout << endl;
	return 0;
}